using System;
using System.Reflection;

namespace MvvmFx.Common.Helpers
{
    /// <summary>
    /// Static utility class with methods for manipulating assemblys
    /// </summary>
    public static class AssemblyHelper
    {
        /// <summary>
        /// Gets the the assembly version number.  
        /// </summary>
        /// <returns>The assembly version number.</returns>
        public static string GetExecutingAssemblyVersionNo()
        {
            Assembly assembly = Assembly.GetExecutingAssembly();
            Version currentVersion = assembly.GetName().Version;
            return currentVersion.ToString(); 
        }

        /// <summary>
        /// Gets the the version number from the specified assembly.  
        /// </summary>
        /// <returns>The assembly version number.</returns>
        public static string GetAssemblyVersionNo(Assembly assembly)
        {
            Version currentVersion = assembly.GetName().Version;
            return currentVersion.ToString();
        }
    }
}